#ifndef DRM_ERRORS_H_

#define DRM_ERRORS_H_

#include <utils/Errors.h>

typedef enum hiDRM_ERROR
{
	MEDIA_ERROR_BASE        = -1000,

    ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE,
    ERROR_NOT_CONNECTED     = MEDIA_ERROR_BASE - 1,
    ERROR_UNKNOWN_HOST      = MEDIA_ERROR_BASE - 2,
    ERROR_CANNOT_CONNECT    = MEDIA_ERROR_BASE - 3,
    ERROR_IO                = MEDIA_ERROR_BASE - 4,
    ERROR_CONNECTION_LOST   = MEDIA_ERROR_BASE - 5,
    ERROR_MALFORMED         = MEDIA_ERROR_BASE - 7,
    ERROR_OUT_OF_RANGE      = MEDIA_ERROR_BASE - 8,
    ERROR_BUFFER_TOO_SMALL  = MEDIA_ERROR_BASE - 9,
    ERROR_UNSUPPORTED       = MEDIA_ERROR_BASE - 10,
    ERROR_END_OF_STREAM     = MEDIA_ERROR_BASE - 11,

    // Not technically an error.
    INFO_FORMAT_CHANGED    = MEDIA_ERROR_BASE - 12,
    INFO_DISCONTINUITY     = MEDIA_ERROR_BASE - 13,
    INFO_OUTPUT_BUFFERS_CHANGED = MEDIA_ERROR_BASE - 14,

    DRM_ERROR_BASE = -2000,

    ERROR_DRM_UNKNOWN                        = DRM_ERROR_BASE,
    ERROR_DRM_NO_LICENSE                     = DRM_ERROR_BASE - 1,
    ERROR_DRM_LICENSE_EXPIRED                = DRM_ERROR_BASE - 2,
    ERROR_DRM_SESSION_NOT_OPENED             = DRM_ERROR_BASE - 3,
    ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED   = DRM_ERROR_BASE - 4,
    ERROR_DRM_DECRYPT                        = DRM_ERROR_BASE - 5,
    ERROR_DRM_CANNOT_HANDLE                  = DRM_ERROR_BASE - 6,
    ERROR_DRM_TAMPER_DETECTED                = DRM_ERROR_BASE - 7,
    ERROR_DRM_NOT_PROVISIONED                = DRM_ERROR_BASE - 8,
    ERROR_DRM_DEVICE_REVOKED                 = DRM_ERROR_BASE - 9,
    ERROR_DRM_RESOURCE_BUSY                  = DRM_ERROR_BASE - 10,
    ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION = DRM_ERROR_BASE - 11,
    ERROR_DRM_LAST_USED_ERRORCODE            = DRM_ERROR_BASE - 11,

    ERROR_DRM_VENDOR_MAX                     = DRM_ERROR_BASE - 500,
    ERROR_DRM_VENDOR_MIN                     = DRM_ERROR_BASE - 999,

} HI_DRM_ERROR;

// returns true if err is a recognized DRM error code
/*static HI_BOOL isCryptoError(status_t err)
{
    return (ERROR_DRM_LAST_USED_ERRORCODE <= err && err <= ERROR_DRM_UNKNOWN)
            || (ERROR_DRM_VENDOR_MIN <= err && err <= ERROR_DRM_VENDOR_MAX);
}*/

#endif  // DRM_ERRORS_H_
